import datetime
import json

import pandas as pd

import sql_util

if __name__ == '__main__':
    file_path = 'C:/Users/asyf/Desktop/26个种猪场).xlsx'
    # 使用read_excel函数读取Excel文件并将其存储为DataFrame对象
    df = pd.read_excel(file_path,converters={'分公司代码': str})
    # 打印读取到的数据
    # print(df)
    print(type(df))
    org_code_list = []
    order_id_list = []
    flag_list = []
    for index, row in df.iterrows():
        # print(row['push_content'])
        org_code = str(row['分公司代码'])
        farm_org = str(row['农场代码'])
        sql = "insert into ZCN_GD2_FR_MAS_TYPE (GD_TYPE, GD_CODE, DESC_LOC, DESC_ENG, CONDITION_01, CONDITION_02, CONDITION_03, CONDITION_04, CONDITION_05, CONDITION_06, CONDITION_07, CONDITION_08, CONDITION_09, CONDITION_10, CANCEL_FLAG, CANCEL_DATE, COMMENT1, USER_CREATE, CREATE_DATE, LAST_USER_ID, LAST_UPDATE_DATE, START_ACTIVE_DATE, END_ACTIVE_DATE) \
values ('breed_farm', '{}', '', null, '', 'Y', null, null, null, null, null, null, null, null, null, null, null, null, null, 'win-13817006604', to_date('25-07-2025', 'dd-mm-yyyy'), null, null);".format(org_code+'#'+farm_org)
        print(sql)
